package com.example.demo.web;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ConfigController {

    @Value("${server.formId}")
    private String formId;

    @Autowired
    private Environment environment;

    @GetMapping("getFormId")
    public String getFormId(){
        System.out.println("formId is " + formId);
        System.out.println("environment formId is " + environment.getProperty("server.formId", "undefined"));
        System.out.println("environment formId is " + environment.getProperty("server.formId2", "undefined"));
        return formId;
    }

}
